<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
            <title>曲线统计-单条</title>
    </head>
    <body>
        <!--Step:2 Prepare a dom for ECharts which (must) has size (width & hight)-->
        <!--Step:2 为ECharts准备一个具备大小（宽高）的Dom-->
        <div id="main" style="height:180px; width:100%;"></div>
        
    </body>
    <!--Step:1 Import echarts-plain.js or echarts-plain-map.js-->
    <!--Step:1 引入echarts-plain.js或者 echarts-plain-map.js-->
    <script src="echarts.min.js"></script>
    <script src="jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
          show(null,null);
          })
        
        function show(data,name){
            var myChart = echarts.init(document.getElementById('main'));
<!--            var datas = new Array();-->
<!--            datas  = data.split("-");-->
<!--            var x= datas[0];-->
<!--            var x1 = eval('[' + x + ']');-->
<!--            var y = datas[1];-->
<!--            var y1 = eval('[' + y + ']');-->




option = {
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    yAxis: {
        minInterval:1,
    }
<!--    legend: {-->
<!--        orient: 'vertical',-->
<!--        x: 'left',-->
<!--        data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']-->
<!--    },-->
    series: [
             {
             name:'访问来源',
             type:'pie',
             radius: ['50%', '70%'],
             avoidLabelOverlap: false,
             label: {
             normal: {
             show: false,
             position: 'center'
             },
             emphasis: {
             show: true,
             textStyle: {
             fontSize: '16',
             fontWeight: 'bold'
             }
             }
             },
             labelLine: {
             normal: {
             show: false
             }
             },
             color:['yellow','#8BC34A'],
             data:[
                   {value:335, name:''},
                   {value:1548, name:''}
                   ]
             }
             ]
};
            myChart.setOption(option);
            var html = "<div style='z-index: 99;position: absolute;margin-top: -108px;margin-left: 40%;'>"+
            "<div style='margin-bottom: 10px;margin-left: 10px;font-size: 12px;"+
            "color: #C5BDBD;'>总收益</div><div>123.00元</div></div>";
                   $("#main").append(html);
                              
        }
    
    
        </script>
</html>
